package ttt;

import ttt.client.GameClient;
import ttt.core.Command;
import ttt.core.Desk;
import ttt.core.XStreamCommand;
import ttt.server.GameServer;

public class Main {

	/**
	 * @param args
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {

	//	XStream xstream = new XStream(new DomDriver());
		XStreamCommand xstream = new XStreamCommand();

		Desk desk = new Desk(new int[2][2]);
		Command cmd = new Command("sendDesk", desk);

		String xml = xstream.toXML(cmd);
//		System.out.println(xml);

		cmd = (Command) xstream.fromXML(xml);

//		System.out.println(cmd.getName());

		if (args.length == 1) {
			if (args[0].equals("s")) {
				new GameServer();
			}
			if (args[0].equals("c")) {
//				System.out.println("start c");
				new GameClient();
			}
		}

	}
}
